<div class="participant">
  <div class="user">
    <%= declaration_payer.user.fullname %>
  </div>
  <div class="action">
    [<%= link_to_remote(
          'Verwijderen',
          :update => "participants", 
          :url => { :controller => 'ajax', 
          :action => 'remove_user_from_declaration',
          :delete_user_id => declaration_payer.user.id },
          :submit => 'declaration_form'
    )%>]
    <%=
    #in_place_select :object, :attribute
    %>
  </div>
  <div class="additional_persons">
    
    <% if edit == true %>
      <%= print_additional_persons_with_edit declaration_payer.user.id, declaration_payer.additional_persons %>
    <% else %>
      <%= print_additional_persons declaration_payer.additional_persons %>
    <% end %>
    
  </div>
  <div class="action">
    
    <% if edit == false %>
    [<%= link_to_remote(
          'Wijzigen',
          :update => "participants", 
          :url => { :controller => 'ajax', 
          :action => 'edit_additional_users_of_declaration',
          :edit_user_id => declaration_payer.user.id },
          :submit => 'declaration_form'
    )%>]
    
    <% else %>
    [<%= link_to_remote(
          'Opslaan',
          :update => "participants", 
          :url => { :controller => 'ajax', 
          :action => 'declaration_users'},
          :submit => 'declaration_form'
    )%>]
    <% end %>
    
  </div>
  <div class="amount">
    <%= declaration_payer.share_as_money %>
  </div>
</div>

<%= hidden_field_tag "declaration_payers[#{declaration_payer.user.id}]", declaration_payer.additional_persons %>
